package com.crowdfunding.service.impl;

import com.crowdfunding.bean.Member;
import com.crowdfunding.bean.Ticket;
import com.crowdfunding.dao.TicketMapper;
import com.crowdfunding.service.TicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TicketServiceImpl implements TicketService {
    @Autowired
    private TicketMapper ticketMapper;
    @Override
    public Ticket getTicketByMemberId(Integer memberid) {
        return ticketMapper.selectByMemberId(memberid);
    }

    @Override
    public Integer saveTicket(Ticket ticket) {
        return ticketMapper.saveTicket(ticket);
    }

    @Override
    public void updatePstep(Ticket ticket) {
        ticketMapper.updatePstep(ticket);
    }

    @Override
    public void updatePiidAndPstep(Ticket ticket) {
        ticketMapper.updatePiidAndPstep(ticket);
    }

    @Override
    public Member getByMemberByPiid(String processInstanceId) {
        return ticketMapper.getByMemberByPiid(processInstanceId);
    }

    @Override
    public void updateStatusByMemberId(Integer memberid) {
        ticketMapper.updateStatusByMember(memberid);
    }
}
